package skcomms.NateOnBiz.activity;

import skcomms.NateOnBiz.common.NatePreference;
import skcomms.NateOnBiz.data.Me;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * access activity from webpage
 * @author hyunsikkim
 *
 */
public class WebDummyActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		boolean bLogon = NatePreference.getBoolean(NatePreference.OnLogin, false);
		
		if(bLogon && Me.get().mIsAfterLogin) {
			Intent intent = new Intent(getApplicationContext(), MainTabActivity.class);
			intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
			intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
		}
		else {
			Intent intent = new Intent(getApplicationContext(), IntroActivity.class);
			intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
			intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
		}
		finish();
	}
}
